UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5WnmfjWI2aNi8tLj1Wsy9R4ksLjgsEvxFMBES3Xrf7w='
WHERE
key_id = '19baad9918a6912009571853355e03d0ec52f6d5ee57c9afdecff84757209c08'
AND (
token = '5WnmfjWI2aNi8tLj1Wsy9R4ksLjgsEvxFMBES3Xrf7w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)