UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F08uGaKZuRmN5wQsJWGxRvIDaLiUdCbNfqPfAwLj7E4='
WHERE
key_id = '9828eb10d8a0dc4a4b648af159b618a9fcde15052d7d51e7abc71b63b888bbb1'
AND (
token = 'F08uGaKZuRmN5wQsJWGxRvIDaLiUdCbNfqPfAwLj7E4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)