UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '20zQ194OlvgurG4KUJrdmofCWDCPVS33iytt7pRrlJ0='
WHERE
key_id = '10f2528209ff9eb3f331b960fca87a0203e14ed600205dfe699bc6a90f393e39'
AND (
token = '20zQ194OlvgurG4KUJrdmofCWDCPVS33iytt7pRrlJ0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)