UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ho51SPbSAuYaxsvNUCzm60B+DQ5A1mE4r7OoFRJ3Kbo=' 
WHERE 
  key_id = 'e122a1d292c0dc0d706e12ebffff686ec32849dbd14b1cacfc118a006d0aff4c' 
  AND (
    token = 'Ho51SPbSAuYaxsvNUCzm60B+DQ5A1mE4r7OoFRJ3Kbo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00264