UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2ITzz4VtvBEpBqeegeHXFSbhYvjplJQviQl79ZumYpU='
WHERE
key_id = '8cc82d27156ea7c59f15db1c239533d5d80062dcd1fe8021f546dc15f2e9df94'
AND (
token = '2ITzz4VtvBEpBqeegeHXFSbhYvjplJQviQl79ZumYpU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)