UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XFEGlw5Snl444FShDyiSpI5NC+yeO+Qxj3oB1OLT6VI='
WHERE
key_id = 'ecc4bc18fafd911771e655777b2ec12fa58e88c640d1fd3ca284411f2f38f3b3'
AND (
token = 'XFEGlw5Snl444FShDyiSpI5NC+yeO+Qxj3oB1OLT6VI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)