UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nJIpflQRk6xhodtYnVaWh8IjyIGZqb4KggkTXKJklq8=' 
WHERE 
  key_id = '16ac0ba582728bb6d076337a34e16aa6bdeefd6d0114971f1ea3722bf1e02163' 
  AND (
    token = 'nJIpflQRk6xhodtYnVaWh8IjyIGZqb4KggkTXKJklq8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027