UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sUpSLpQTTq3GiQrCYdQsuHD3XJXHlKqGQz7bA71VyFQ='
WHERE
key_id = '061e41c7108dff2be071c096c89f8f8f5a076a9d00c612d5288228d3924a58cf'
AND (
token = 'sUpSLpQTTq3GiQrCYdQsuHD3XJXHlKqGQz7bA71VyFQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)