UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ew1P3yvBC5ZUEz6ABxAveN+pW3KT67DYrEKN3vxRPbQ='
WHERE
key_id = 'f6f10663898bdd7380a6ee346e73e033da560a235cde401f9a91ebbf9c867a46'
AND (
token = 'ew1P3yvBC5ZUEz6ABxAveN+pW3KT67DYrEKN3vxRPbQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)