UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4K6gdSLPTRhY3/PkQGSFv4uzvzz1wPRRNK+pLxzqNxE='
WHERE
key_id = 'b6cd87670a506beb73252780f8af2f474190a31d122d93fb74c4535ebc2dc2ae'
AND (
token = '4K6gdSLPTRhY3/PkQGSFv4uzvzz1wPRRNK+pLxzqNxE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)