UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cj9OCEt5al+82Ou2Z96PDwdt0+zAlqXFvdf78hZNspg=' 
WHERE 
  key_id = 'c5329f3556143b8acf2f4883230ec3aac5420624d2e39420fb0f138f1b3bb26f' 
  AND (
    token = 'cj9OCEt5al+82Ou2Z96PDwdt0+zAlqXFvdf78hZNspg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029