UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EI2zV8lVZWEZblccBfeSr6Ddv4KbsdNwoJvOFGDHe5o='
WHERE
key_id = '1be4c8d04eb3dd9f498916f14de10cf3fa5747f25e6decf357d3b557d5516786'
AND (
token = 'EI2zV8lVZWEZblccBfeSr6Ddv4KbsdNwoJvOFGDHe5o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)