UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'geFfPv7wbGxRIHKkyPnnlMPSopsvhnFBRbssvOJiFPs='
WHERE
key_id = 'dfac15b80be68f07298fffbd6ec299f292f2e0b4618412d09059cec0cef58dbc'
AND (
token = 'geFfPv7wbGxRIHKkyPnnlMPSopsvhnFBRbssvOJiFPs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)