UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DeJ4h+SS9/GvSv/oqDmq0UKHKdEk4nDeqY4g/8c5HlY='
WHERE
key_id = '08a13868c5f5f78c1902d2da94ac05d77b6af58c2520f7079c652f950f204ec6'
AND (
token = 'DeJ4h+SS9/GvSv/oqDmq0UKHKdEk4nDeqY4g/8c5HlY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)