UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zKPzFKE2zHolvPx8NJrDVMl/AVdWOOKA+3V6syn8hGA=' 
WHERE 
  key_id = 'a04dfbfde987037172da87419ebbb2aeb9be80b899c9ae422ac86e0bd5275370' 
  AND (
    token = 'zKPzFKE2zHolvPx8NJrDVMl/AVdWOOKA+3V6syn8hGA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047