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