UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gvecGPZDf2MjeNHzEeRsls/LX6P6Hy7w6cG85hK/oRU='
WHERE
key_id = '803a21faf944ee485e17897fb224a279c2a2e90c0cc26ec194bb629c36dbcf48'
AND (
token = 'gvecGPZDf2MjeNHzEeRsls/LX6P6Hy7w6cG85hK/oRU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)