UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vxRuX/Oyi634D86nmqdWdk5cCT8zpKE37ibvsGAqGZ4=' 
WHERE 
  key_id = '2674007c48adde283eb3b1b7bad0f430bdc516c990c8f3f8e0808660dcdb4b4c' 
  AND (
    token = 'vxRuX/Oyi634D86nmqdWdk5cCT8zpKE37ibvsGAqGZ4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00012