UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+TTpFkFYfhgG2Mk5qqtd3fvQObHanvBSbARm1LnSIRQ='
WHERE
key_id = '7a6b4342c66240056161c4e96493cff2d509c0273f9cd60d585b03ba67c69b1a'
AND (
token = '+TTpFkFYfhgG2Mk5qqtd3fvQObHanvBSbARm1LnSIRQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)