UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UPNXBqLFgozX7z/IOgl7DXHx12Z+LNEHc+SLeEt8864=' 
WHERE 
  key_id = '050249d6f0c1c04927b0a7ba80958d31f26bdabf34e6745820ba632575591d45' 
  AND (
    token = 'UPNXBqLFgozX7z/IOgl7DXHx12Z+LNEHc+SLeEt8864=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051