UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'L4BA4gAgsXRAtSxduqjw5Fe4IAHxJL8fWK7O6Vwkcks='
WHERE
key_id = '3b0f850e96e94a47578acfbf832ca14207f620f6923dacd77d306776bd0b5411'
AND (
token = 'L4BA4gAgsXRAtSxduqjw5Fe4IAHxJL8fWK7O6Vwkcks='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)