UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Zg6kJNuhyJkuycUAG4TFBqIfRbSff8vEzuOjLvQAETk=' 
WHERE 
  key_id = '2b5b9e72766584d67d727343c5b949b9e68ae5b3514daafbac1f89bf0fb21c05' 
  AND (
    token = 'Zg6kJNuhyJkuycUAG4TFBqIfRbSff8vEzuOjLvQAETk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033