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