UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3yUzG5SCOZHoD6rt21ryVSCP4VCOZxgKPfIrDltIwfA=' 
WHERE 
  key_id = '6c62e758660cdd1ec90af00760fbb0c3baecc0cec041dc1560df72dd8bbdcb48' 
  AND (
    token = '3yUzG5SCOZHoD6rt21ryVSCP4VCOZxgKPfIrDltIwfA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026