UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+BbueOF+EsNLLA96ZqSS49S9NnBtmScrzHzbfcLiY18='
WHERE
key_id = 'd2931d322bc2c8db2ac920122145719ccc5ee1a06433487d9d031e7482b38b9b'
AND (
token = '+BbueOF+EsNLLA96ZqSS49S9NnBtmScrzHzbfcLiY18='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)