UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+P3acSF/q8FgRxnwXrqw3Gx7U9GUp/zJEx4oPV9ieFg='
WHERE
key_id = 'a6e15dff02ff0c0ed85b9a80e367bb3414941e9e28e1db7c5ffb5acb40ab4b2a'
AND (
token = '+P3acSF/q8FgRxnwXrqw3Gx7U9GUp/zJEx4oPV9ieFg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)