UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'j4nllZ9YFktgArqDG02R4jaFQOgxZ5NhnWFvuozDtyg=' 
WHERE 
  key_id = 'cd4cabe7af9a96610c7fb57c9018832e612a8b9e8a17e100f5d298656f08c849' 
  AND (
    token = 'j4nllZ9YFktgArqDG02R4jaFQOgxZ5NhnWFvuozDtyg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051