UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CyT5xPtdMQBZLZytpcYaW1kvgeMsWJGKJ6LkXoBBvVM='
WHERE
key_id = 'bbcb0c6c04275aa266d6eaeb53a1d5b11fa13d87baf8275e1f68b4ce161a5db9'
AND (
token = 'CyT5xPtdMQBZLZytpcYaW1kvgeMsWJGKJ6LkXoBBvVM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)