UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/cAm4E/L4yp8ubbLo0mkot1kbeMUnnlcstBoGQ8egDA='
WHERE
key_id = 'ce47383ea6c3800ae2d379004f7cba9f7103cde352834ccb87d1d6d1abceadcf'
AND (
token = '/cAm4E/L4yp8ubbLo0mkot1kbeMUnnlcstBoGQ8egDA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)