UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'u0Q+jdJMOjNnVP2mXSDfSj9MDAEoi8h6Cz21rvdaSWo='
WHERE
key_id = '283bbafb045dc308ae8f4709fa9ff86f077409a900fe6f67c54e84e523207542'
AND (
token = 'u0Q+jdJMOjNnVP2mXSDfSj9MDAEoi8h6Cz21rvdaSWo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)