UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XvcoVSjc/wfhQupOUFc+gXogJhayWxm6MDOcBf35Wcc=' 
WHERE 
  key_id = '926a2fd7abcc841939b967a69c58e27e9883f8e92aad986bc6acc86a45231eb3' 
  AND (
    token = 'XvcoVSjc/wfhQupOUFc+gXogJhayWxm6MDOcBf35Wcc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051