UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'm6MEK3sg8AQ4QkTTrqbqheLrQeewbpKl2inGyjzPjkU='
WHERE
key_id = 'faf884f708ed23e4c1450d430fff2caea2c4817ff421fe8ddd5c79c32c8a0bb8'
AND (
token = 'm6MEK3sg8AQ4QkTTrqbqheLrQeewbpKl2inGyjzPjkU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)