UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9yh0SV8jNEg/rk/C4JFPHPT4+83CRAVMKXEzvMqRh3M='
WHERE
key_id = '6bbe13e644575e33b01ee87fa35b923085433b3a3836cc82714d60df64f831bd'
AND (
token = '9yh0SV8jNEg/rk/C4JFPHPT4+83CRAVMKXEzvMqRh3M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)