UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dXP3L2wfUBYEs0H0eMF2xWj2o5yRtsgYpU2QubDsGAw='
WHERE
key_id = '722dd1455b7941a90c087d61e79ba2a0c1186e85ca74c03f4f28890489bf9496'
AND (
token = 'dXP3L2wfUBYEs0H0eMF2xWj2o5yRtsgYpU2QubDsGAw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)